#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>

LEAF(my4_madd_test)
    .set noreorder
    addiu s0, s0 ,1
    addiu s2, zero, 0x0
    lui   t2, 0x1
###test inst
    li t0,0x2222;
    li t1,0x3333;
    madd t0,t1;

    TEST_MType(0x45b90738, 0xd70d64f0, 0x0a20a481, 0xf4d903bd,0x1,0x2,madd)
    TEST_MType(0x99a451b0, 0xbe3d9998, 0x8552b082, 0x1a4b01b1,0x2,0x3,madd)
    TEST_MType(0x85931c58, 0xfb710fb5, 0xda843239, 0x022e0edf,0x1,0x1,madd)
    TEST_MType(0x650e4043, 0x64c17218, 0x7076dc49, 0x27c5ede3,0x1,0x1,madd)
    TEST_MType(0xa00c6c50, 0x8e9df080, 0x78d12801, 0x2a7f453f,0x1,0x1,madd)
    TEST_MType(0x99c874b6, 0xd7ce83e0, 0xe7934141, 0x100c6ff5,0x1,0x1,madd)
    TEST_MType(0x1c62f360, 0x34580400, 0xb4cd8001, 0x05cddbe5,0x1,0x1,madd)
    TEST_MType(0x99b80b00, 0x6c463000, 0x84100001, 0xd4bd99ca,0x1,0x1,madd)
    TEST_MType(0xdc823390, 0x5208f838, 0x1aeec781, 0xf4a0762d,0x1,0x1,madd)
    TEST_MType(0xe53080d8, 0x848a9c5a, 0xf600ebf1, 0x0cedfd5d,0x1,0x1,madd)
    TEST_MType(0x7f2163d8, 0xab5bba80, 0x9904dc01, 0xd5f77756,0x1,0x1,madd)
    TEST_MType(0xea7b88c0, 0x23eed510, 0xd3004c01, 0xfcfad0a3,0x1,0x1,madd)
    TEST_MType(0x7389b4fd, 0xea063940, 0x0ba79441, 0xf614f984,0x1,0x1,madd)
    TEST_MType(0xbcdf9b20, 0xc1451978, 0x4e96d701, 0x1072da6b,0x1,0x1,madd)
    TEST_MType(0xdcacfd50, 0x809d0a80, 0x7273c801, 0x1193d5fd,0x1,0x1,madd)
    TEST_MType(0x55ed3100, 0xbe5ba9f2, 0x3a915201, 0xe9f79dba,0x1,0x1,madd)
    TEST_MType(0xcedb5fd8, 0xe1793b60, 0x4672b901, 0x05dc29b0,0x1,0x1,madd)
    TEST_MType(0x9d32f1b0, 0xbb2016b8, 0x2362d681, 0x1a94e276,0x1,0x1,madd)
    TEST_MType(0x7091ae43, 0xdb390460, 0x9b456521, 0xefd4042d,0x1,0x1,madd)
    TEST_MType(0x549bf440, 0xd1dc9f40, 0x2ab0d001, 0xf0c048d1,0x1,0x1,madd)
    TEST_MType(0x63b241cc, 0x48aefe14, 0xbfdd8bf1, 0x1c4e489d,0x1,0x1,madd)
    TEST_MType(0x4c925040, 0x0855d2c8, 0x7d633201, 0x027e3e23,0x1,0x1,madd)
    TEST_MType(0xdb2dfd2c, 0x6c0e9f09, 0xad443a8d, 0xf0754c73,0x1,0x1,madd)
    TEST_MType(0xdfdc9250, 0xbf1f15c3, 0x04b402f1, 0x082517d5,0x1,0x1,madd)
    TEST_MType(0x1b339b35, 0x98c14bc0, 0x0021eec1, 0xf50792e8,0x1,0x1,madd)
    TEST_MType(0xc8618b98, 0x69452a40, 0x1141d601, 0xe920fb5f,0x1,0x1,madd)
    TEST_MType(0x2aea0580, 0x7f50d684, 0xf943d601, 0x1557a5d2,0x1,0x1,madd)
    TEST_MType(0x5c69f5ec, 0x9ee23bd2, 0xfcf11f99, 0xdcf11aff,0x1,0x1,madd)
    TEST_MType(0xb7b66b40, 0x8b50c179, 0xa013f141, 0x20f2d35c,0x1,0x1,madd)
    TEST_MType(0x514e33b6, 0x7dc39988, 0x30153eb1, 0x27f14e95,0x1,0x1,madd)
    TEST_MType(0x27c24e12, 0xbc0e6874, 0x70beb029, 0xf572a01d,0x1,0x1,madd)
    TEST_MType(0xe7e6eddc, 0x13a7cad0, 0x21d4dac1, 0xfe265836,0x1,0x1,madd)
    TEST_MType(0xa85111c0, 0xa29d50f0, 0x844ca401, 0x1ffc597b,0x1,0x1,madd)
    TEST_MType(0x73d52eb8, 0x142ba310, 0x32fa1381, 0x0920663e,0x1,0x1,madd)
    TEST_MType(0x41156884, 0x794c5fb2, 0x9ddba7c9, 0x1ed68916,0x1,0x1,madd)
    TEST_MType(0xa8774820, 0xb2cf0480, 0xaaa49001, 0x1a64def0,0x1,0x1,madd)
    TEST_MType(0xb69bcb80, 0x88d55520, 0xdf8af001, 0x2229cfd5,0x1,0x1,madd)
    TEST_MType(0xe84175d8, 0x94048f1c, 0xaf5c8ba1, 0x0a03f609,0x1,0x1,madd)
    TEST_MType(0x6fdedbd8, 0x67dd7f60, 0x341a9901, 0x2d637582,0x1,0x1,madd)
    TEST_MType(0xa2319526, 0xd5f88700, 0x40770a01, 0x0f669a84,0x1,0x1,madd)
    TEST_MType(0x61f8b9bc, 0x146e6d38, 0xd445ad21, 0x07d1b12f,0x1,0x1,madd)
    TEST_MType(0xb9002828, 0x0310a1b9, 0xc4de2ce9, 0xff2663a1,0x1,0x1,madd)
    TEST_MType(0xb4418f47, 0x943f129c, 0xc27f4d45, 0x1fe1ae2f,0x1,0x1,madd)
    TEST_MType(0xd7011f8c, 0x70d8ea80, 0x6585be01, 0xededc133,0x1,0x1,madd)
    TEST_MType(0x058b9998, 0x55395538, 0x3b611141, 0x01d897ee,0x1,0x1,madd)
    TEST_MType(0xc13b7fc0, 0xda192fbb, 0x0caa9141, 0x094afe26,0x1,0x1,madd)
    TEST_MType(0x776d24b0, 0x66f0a9a4, 0x1423b0c1, 0x3005c215,0x1,0x1,madd)
    TEST_MType(0x6c6ae338, 0x5c4abc80, 0x827ebc01, 0x27161063,0x1,0x1,madd)
    TEST_MType(0x9dc090e0, 0xb6324980, 0x55585001, 0x1c530987,0x1,0x1,madd)
    TEST_MType(0x86d609de, 0xcd4bcb2e, 0x9e52cfe5, 0x17ff7c94,0x1,0x1,madd)
    TEST_MType(0x1400c7dc, 0x466a6d5e, 0x967a0ec9, 0x05808785,0x1,0x1,madd)
    TEST_MType(0xa2d88860, 0x26423686, 0x52dba241, 0xf2140c3b,0x1,0x1,madd)
    TEST_MType(0x6770770a, 0x812cbe10, 0x6f18dca1, 0xccc14913,0x1,0x1,madd)
    TEST_MType(0x95627048, 0xc1bae8ca, 0xf1bdd8d1, 0x19eeeef1,0x1,0x1,madd)
    TEST_MType(0x1dbadda0, 0x5d2b0f50, 0x9741a201, 0x0ad1e2ae,0x1,0x1,madd)
    TEST_MType(0xc7cf4f96, 0x7dd33820, 0x29f4c2c1, 0xe461dd6a,0x1,0x1,madd)
    TEST_MType(0xa1d8f960, 0xb83e3183, 0xbf02fc21, 0x1a641a34,0x1,0x1,madd)
    TEST_MType(0xcc2c955e, 0x63c2877e, 0x8bf21645, 0xebcddc1f,0x1,0x1,madd)
    TEST_MType(0xd2d44530, 0x602b39e6, 0x4d2dd921, 0xef07f963,0x1,0x1,madd)
    TEST_MType(0x886c3ad7, 0xe011a4c0, 0xaf24dd41, 0x0eea3ae1,0x1,0x1,madd)
    TEST_MType(0x0c45d0c8, 0x830e02fb, 0x57054419, 0xfa029505,0x1,0x1,madd)
    TEST_MType(0x49979c44, 0x298742f0, 0x604807c1, 0x0bf02a39,0x1,0x1,madd)
    TEST_MType(0x2037c800, 0xfb355f34, 0xa68ca001, 0xff65a0a0,0x1,0x1,madd)
    TEST_MType(0x21e68aeb, 0xc1cc4ec0, 0x897fca41, 0xf7c351f5,0x1,0x1,madd)
    TEST_MType(0xe2c488b8, 0x8ed6a9d8, 0x6de4d341, 0x0cebf804,0x1,0x1,madd)
    TEST_MType(0x0622c000, 0x849e669e, 0x21f28001, 0xfd0af6e9,0x1,0x1,madd)
    TEST_MType(0xfe11325e, 0x5a980480, 0x4132a701, 0xff50e5e3,0x1,0x1,madd)
    TEST_MType(0xb582a660, 0x27161c30, 0x3ef1b201, 0xf4a07860,0x1,0x1,madd)
    TEST_MType(0xde436ee0, 0x0b8fd2ea, 0x09b718c1, 0xfe79f1a4,0x1,0x1,madd)
    TEST_MType(0x3ca5ebcc, 0x7fca89b0, 0xc03a4841, 0x1e464b85,0x1,0x1,madd)
    TEST_MType(0xed8ac2a2, 0x8e11d628, 0xe523d551, 0x0836ec1a,0x1,0x1,madd)
    TEST_MType(0xee62ac9c, 0x446aed90, 0x59e583c1, 0xfb4ada5d,0x1,0x1,madd)
    TEST_MType(0xa5a41fa0, 0x901ecf7a, 0x5a897241, 0x277d522b,0x1,0x1,madd)
    TEST_MType(0x1665a95c, 0x01fa0f1c, 0x27e2ea11, 0x002c4644,0x1,0x1,madd)
    TEST_MType(0xf760c288, 0x024d9a70, 0x0242eb81, 0xffec246d,0x1,0x1,madd)
    TEST_MType(0xdb906f30, 0x0eafa7d0, 0x3fb2a701, 0xfde8e5ef,0x1,0x1,madd)
    TEST_MType(0x5aa5b57e, 0xeb138c80, 0x1475a701, 0xf897542a,0x1,0x1,madd)
    TEST_MType(0xbc61fc9c, 0x2c0b0f78, 0xb66f8d21, 0xf45deb8b,0x1,0x1,madd)
    TEST_MType(0x8b3566b7, 0x2b021ecc, 0xbb054bd5, 0xec61009f,0x1,0x1,madd)
    TEST_MType(0x666e54e8, 0xed91452c, 0x37411fe1, 0xf89fefdf,0x1,0x1,madd)
    TEST_MType(0xc6e59380, 0xfa935180, 0xc8f54001, 0x0135c231,0x1,0x1,madd)
    TEST_MType(0xd921e0b0, 0x1f7d65c0, 0x3cfdf401, 0xfb38104e,0x1,0x1,madd)
    TEST_MType(0x7b8db2e2, 0x84d37b50, 0xa9807ca1, 0xc48d6ea9,0x1,0x1,madd)
    TEST_MType(0xf89e1b58, 0x26be32a0, 0x9f784701, 0xfee1fbf2,0x1,0x1,madd)
    TEST_MType(0x524aa0a6, 0x0b334594, 0xd3839df9, 0x0399b023,0x1,0x1,madd)
    TEST_MType(0xa3be10e8, 0x18dbc860, 0x1af39701, 0xf70a9cf9,0x1,0x1,madd)
    TEST_MType(0x073cf5be, 0x4fbf4882, 0xccd43a7d, 0x0241385e,0x1,0x1,madd)
    TEST_MType(0x91db7100, 0x1f78ebb0, 0xaf98b001, 0xf2758c25,0x1,0x1,madd)
    TEST_MType(0xc49e36d8, 0x2044fa90, 0xabedc981, 0xf883c6c3,0x1,0x1,madd)
    TEST_MType(0xaf4ab2b8, 0xf0086f40, 0x4bea7601, 0x0508ac18,0x1,0x1,madd)
    TEST_MType(0xc72f0de2, 0x407a26e0, 0x62efb1c1, 0xf1b0a745,0x1,0x1,madd)
    TEST_MType(0x95d26876, 0x9aaece1c, 0xaf4660e9, 0x2a05a9e8,0x1,0x1,madd)
    TEST_MType(0x72e2ec10, 0xb9098e00, 0xbb80e001, 0xe0275a3c,0x1,0x1,madd)
    TEST_MType(0xdeb27a9c, 0x506c0849, 0x8e89d67d, 0xf589b889,0x1,0x1,madd)
    TEST_MType(0x530194f0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x5a1a4f60, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x5cc4e136, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0xab7a14c0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x44d126d0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x0f114ff0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x60bfe48e, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x102ceba0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x7b21e54d, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x5d72f954, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x2699b2d4, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x66b6dc30, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x4ae569a0, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x2582c9c0, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0xa2f01d2e, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x2c5300d7, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x7a95fab0, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0xf415d1b4, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x0caf7d5c, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0xae15e524, 0x00000001, 0x00000001,0x1,0x1,madd)
    TEST_MType(0x00000000, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,madd)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
test:
    beq s0,s3,inst_error
    nop
    addiu s3,s3,1
    j test
    nop
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)
    jr ra
    nop
END(my4_madd_test)
